<?php
// +----------------------------------------------------------------------
//            -------------------------
//           /   / ----------------\  \
//          /   /             \  \
//         /   /              /  /
//        /   /    /-------------- /  /
//       /   /    /-------------------\  \
//      /   /                   \  \
//     /   /                     \  \
//    /   /                      /  /
//   /   /      /----------------------- /  /
//  /-----/      /---------------------------/
// +----------------------------------------------------------------------
// | Copyright (c) 2016 http://baimifan.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 汪利东,2016-04-19 10:16
// +----------------------------------------------------------------------

namespace Delivery\Controller;


use Think\Controller;

class BaseController extends Controller
{
    public function __construct()
    {
        parent::__construct();

        header('Content-Type:text/html;charset=utf-8');

        if (!session('?delivery_man')) {
            $this->redirect('Login/index');
        }

        layout('Public_layout');

        $footer['badge'] = D('DeliveryMy')->where(['type' => 1, 'state_order' => 2, 'man_id' => session('delivery_man.man_id')])->count();
        $this->footer = $footer;
    }
}